package com.ba.pojo;

import util.CardComparator;

import java.util.ArrayList;
import java.util.List;

public class Player {
    private List<Card> cards = new ArrayList<>();
    private String name;

    public Player(String name) {
        this.name = name;
    }

    public void receiveCard(Card card) {
        cards.add(card);
    }

    public void showCards() {
        // 排序
        cards.sort(new CardComparator());
        System.out.println();
        System.out.print(name+ " : ");
        for(Card card : cards) {
            System.out.print(card+" ");
        }
        System.out.println();
    }
}
